
package com.sy.core.service;


import com.sy.core.mapper.SysUserMapper;
import com.sy.core.model.SysUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;





/**
 * 	TODO 请用一句话描述该类的作用
 * @author CaiXinChong email:1060296473@qq.com
 * @version 1.0
 * @since 1.0
 */

@Service("SysUserService")
public class SysUserService  {

	protected final Logger logger = LoggerFactory.getLogger(SysUserService.class);

   	@Autowired
    private SysUserMapper  sysUserMapper;

	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (查询对象集合)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public List<SysUser> queryByCondition(SysUser sysUser){
		return sysUserMapper.queryByCondition(sysUser);
	};

	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (根据主键查询对象)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public SysUser queryByPrimaryKey(String key){
		return sysUserMapper.queryByPrimaryKey(key);
	};

	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (新增单个对象)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public void insert(SysUser sysUser){ sysUserMapper.insertSelective(sysUser);};
	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (修改单个对象)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public void update(SysUser sysUser){ sysUserMapper.updateSelective(sysUser);};


	/**
	 * All rights Reserved, Designed By Chong.CaiXin
	 * @Description: (根据主键删除对象)
	 * @author: Chong.CaiXin
	 * @version V1.0
	 *
	 */
	public void delete(String pk){ sysUserMapper.deleteByPrimaryKey(pk);};

	public void batchDelete(String pks) {
		sysUserMapper.batchDelete(pks);
	}


	public SysUser queryUserByPhoneAndPassword(String phone,String password) {
		return sysUserMapper.queryUserByPhoneAndPassword(phone,password);
	}
}
